﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="HomePage.aspx.cs" Inherits="SATF.HomePage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <ext:PageManager ID="PageManager1" AutoSizePanelID="RegionPanel1" runat="server" />
    <ext:RegionPanel ID="RegionPanel1" ShowBorder="false" runat="server">
        <Regions>
            <ext:Region ID="mainRegion" ShowHeader="false" Layout="Fit" Margins="0 0 0 0" Position="Center" runat="server">
                <Items>
                    <ext:Grid ID="myTaskGrid" ShowBorder="true" ShowHeader="true" Title="我的任务"  AutoHeight="true"
                        runat="server" DataKeyNames="Guid" AutoWidth="True" TableRowspan="1" EnableRowDoubleClick="true" 
                        OnRowDoubleClick="MyTaskGrid_RowClick" AllowSorting="true" PageSize="10" >
                        <Columns>   
                            <ext:TemplateField Width="60px">
                                <ItemTemplate>
                                    <asp:Label ID="Label1" runat="server" Text='<%# Container.DataItemIndex + 1 %>'></asp:Label>
                                </ItemTemplate>
                            </ext:TemplateField>
                            <ext:BoundField Width="60px" DataField="ID" DataFormatString="{0}" HeaderText="任务ID" SortField="ID" />
                            <ext:BoundField Width="100px" DataField="Name" DataFormatString="{0}" HeaderText="任务名" SortField="Name" />
                            <ext:BoundField Width="100px" DataField="CaseFile" DataFormatString="{0}" HeaderText="用例文件" />
                            <ext:TemplateField Width="60px" HeaderText="当前状态" SortField="Exec_State">
                                <ItemTemplate>
                                    <asp:Label ID="Label2" runat="server" Text='<%# GetExecState(Eval("Exec_State")) %>' ForeColor='<%# GetExecStateColor(Eval("Exec_State")) %>'></asp:Label>
                                </ItemTemplate>
                            </ext:TemplateField>
                            <ext:BoundField Width="100px" DataField="Create_DateTime" DataFormatString="{0:yy-MM-dd}"
                                HeaderText="创建时间" SortField="Create_DateTime" />
                            <ext:BoundField Width="100px" DataField="Last_Exec_DateTime" DataFormatString="{0:yy-MM-dd hh:mm:ss}"
                                HeaderText="上次执行时间" SortField="Last_Exec_DateTime" />
                        </Columns>
                    </ext:Grid>
                </Items>
             </ext:Region>


            <ext:Region ID="Region1" Margins="0 0 0 0" ShowBorder="false" ShowHeader="false"
                Position="Bottom" Layout="Fit" runat="server">
                <Toolbars>
                    <ext:Toolbar ID="Toolbar1" Position="Bottom" runat="server">
                        <Items>
                        
                            <ext:LinkButton  ID="btnRunLast" Text="执行上次任务" OnClick="RunLastTaskBtn_Clicked"
                                runat="server">
                            </ext:LinkButton >
                            <ext:Label ID="Label3" Width="100px" runat="server" Label="Label" >
                            </ext:Label>
                            <ext:LinkButton ID="btnCopyCreate" Text="拷贝新建任务" OnClick="CopyCreateBtn_Clicked"
                                runat="server">
                            </ext:LinkButton>
                        </Items>
                    </ext:Toolbar>
                </Toolbars>
            </ext:Region>
        </Regions>
    </ext:RegionPanel>

    </form>
</body>
</html>
